package com.zzy.j1114iocdemo.controller;


import com.zzy.j1114iocdemo.config.UserConfig;
import com.zzy.j1114iocdemo.model.UserInfo;
import com.zzy.j1114iocdemo.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Controller;

@Controller
public class UserController {

    //@Autowired
//    private UserService userService;
//    private UserConfig userConfig;

//    public UserController(){
//    }

//    public UserController(UserService userService) {
//        this.userService = userService;
//    }
//
//
//    @Autowired
//    public UserController(UserService userService, UserConfig userConfig) {
//        this.userService = userService;
//        this.userConfig = userConfig;
//    }


//    @Resource(name="u2")
//    private UserInfo userInfo;

    @Qualifier("u1")
    @Autowired
    private UserInfo userInfo;

//    @Autowired
//    public void setUserService(UserService userService) {
//        this.userService = userService;
//    }

    public void sayhi(){
        System.out.println("hi controller");
        //userService.sayhi();
        System.out.println(userInfo);
    }
}
